package zmee.pur.src.report;

import kd.bos.context.RequestContext;
import kd.bos.entity.report.FilterInfo;
import kd.bos.entity.report.ReportQueryParam;
import kd.bos.report.plugin.AbstractReportFormPlugin;

import java.util.Date;
import java.util.EventObject;

/**
 * @Author: xw
 * @Date: 2023/01/09/14:34
 * @Description: 招标情况汇总报表页面插件；招标单位默认登录组织，可多选
 */
public class BidSummaryRptFormPlugin extends AbstractReportFormPlugin {

    @Override
    public void beforeBindData(EventObject e) {
        super.beforeBindData(e);
        long orgId = RequestContext.get().getOrgId();
        Object[] orgIds = new Object[1];
        orgIds[0] = orgId;
        this.getModel().setValue("zmee_org", orgIds);
    }

    @Override
    public boolean verifyQuery(ReportQueryParam queryParam) {
        FilterInfo filter = queryParam.getFilter();
        Date time = filter.getDate("zmee_time");
        if (time == null) {
            this.getView().showTipNotification("请选择日期");
            return false;
        }
        return true;
    }
}
